package com.bcxj.apiboss.controller;

import com.bcxj.apiboss.service.DriverCarBindingRelationshipService;
import com.bcxj.internalcommon.dto.ResponseResult;
import com.bcxj.internalcommon.entity.DriverCarBindingRelationship;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: DriverCarBindingRelationshipController
 * Package: com.bcxj.apiboss.controller
 * Description:
 *
 * @Author BCXJ
 * @Create 2024/10/20 17:06
 * @Version 1.0
 * @Since 1.0
 */
@RestController
@RequestMapping("/driver-car-binding-relationship")
public class DriverCarBindingRelationshipController {

    @Autowired
    private DriverCarBindingRelationshipService driverCarBindingRelationshipService;

    /**
     * bing车辆绑定
     * @param driverCarBindingRelationship
     * @return
     */
    @PostMapping("/bind")
    public ResponseResult bing(@RequestBody DriverCarBindingRelationship driverCarBindingRelationship){
        return driverCarBindingRelationshipService.bind(driverCarBindingRelationship);
    }


    /**
     * 司机与车辆解绑
     * @param driverCarBindingRelationship
     * @return
     */
    @PostMapping("/unbind")
    public ResponseResult unBind(@RequestBody DriverCarBindingRelationship driverCarBindingRelationship){
        return driverCarBindingRelationshipService.unBind(driverCarBindingRelationship);
    }
}
